<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditRoomTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditRoomLabel_roomPK_roomNumber}" for="roomPK_roomNumber" />
                    <h:inputText id="roomPK_roomNumber" value="#{roomController.selected.roomPK.roomNumber}" title="#{bundle.EditRoomTitle_roomPK_roomNumber}" required="true" requiredMessage="#{bundle.EditRoomRequiredMessage_roomPK_roomNumber}"/>
                    <h:outputLabel value="#{bundle.EditRoomLabel_type}" for="type" />
                    <h:inputText id="type" value="#{roomController.selected.type}" title="#{bundle.EditRoomTitle_type}" required="true" requiredMessage="#{bundle.EditRoomRequiredMessage_type}"/>
                    <h:outputLabel value="#{bundle.EditRoomLabel_price}" for="price" />
                    <h:inputText id="price" value="#{roomController.selected.price}" title="#{bundle.EditRoomTitle_price}" />
                    <h:outputLabel value="#{bundle.EditRoomLabel_hotel1}" for="hotel1" />
                    <h:selectOneMenu id="hotel1" value="#{roomController.selected.hotel1}" title="#{bundle.EditRoomTitle_hotel1}" required="true" requiredMessage="#{bundle.EditRoomRequiredMessage_hotel1}">
                        <f:selectItems value="#{hotelController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{roomController.update}" value="#{bundle.EditRoomSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditRoomViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{roomController.prepareList}" value="#{bundle.EditRoomShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditRoomIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
